layui.config({
    base: '/admin/lib/layui_exts/' //配置 layui 第三方扩展组件存放的基础目录
}).extend({
    inputtags: 'inputtags/inputtags',
    croppers:'cropper/croppers',
}).use(['inputtags', 'jquery','form','croppers'], function() {
    // var inputtags = new layui.inputtags;
    var form = layui.form;
    var croppers = layui.croppers;
    //创建一个头像上传组件
    croppers.render({
        elem: '.layui-upload-list.thumbBox.mag0.magt3'
        ,saveW:500     //保存宽度
        ,saveH:500
        ,mark:3/3    //选取比例
        ,area:'800px'  //弹窗宽度
        ,url: "/agoni/upload"  //图片上传接口返回和（layui 的upload 模块）返回的JOSN一样
        ,done: function(url){ //上传完毕回调
            $("#pic").val(url);
            $("#srcimgurl").attr('src',url);
        }
    });
});
